// 全电相关
import request from '@/utils/request'
const prodApi = {
  listCategory(params) {
    return request({
      url: '/prod/category/listCategory',
      method: 'post',
      params
    })
  },
  modifyCategory(categoryId) {
    return request({
      url: `/prod/category/info/${categoryId}`,
      method: 'get'
    })
  },
  prodCategory(data) {
    return request({
      url: '/prod/category',
      method: data.method,
      data: data.data
    })
  },
  categoryTable() {
    return request({
      url: '/prod/category/table',
      method: 'get'
    })
  },
  deleteByCategoryId(id) {
    return request({
      url: `/prod/category/${id}`,
      method: 'delete'
    })
  },
  prodCommInFo(prodCommId) {
    return request({
      url: `/prod/prodComm/info/` + prodCommId,
      method: 'get'
    })
  },
  prodComm(data) {
    return request({
      url: `/prod/prodComm`,
      method: data.method,
      data: data.data
    })
  },
  prodCommPage(params) {
    return request({
      url: `/prod/prodComm/page`,
      method: 'GET',
      params
    })
  },
  deleteProdCommById(prodCommId) {
    return request({
      url: `prod/prodComm/` + prodCommId,
      method: 'delete'
    })
  },
  getProdInfoById(prodId) {
    return request({
      url: `/prod/${prodId}`,
      method: 'GET'
    })
  },
  deleteProdInfoById(ids) {
    return request({
      url: `/prod/${ids}`,
      method: 'delete'
    })
  },
  prodTagById(id) {
    return request({
      url: '/prod/prodTag/info/' + id,
      method: 'GET'
    })
  },
  prodTag(data) {
    return request({
      url: '/prod/prodTag',
      method: data.method,
      data: data.data
    })
  },
  prodTagPage(params) {
    return request({
      url: '/prod/prodTag/page',
      method: 'GET',
      params
    })
  },
  prodTagDeleteById(id) {
    return request({
      url: '/prod/prodTag/' + id,
      method: 'delete'
    })
  },
  prodSpec(data) {
    return request({
      url: '/prod/spec',
      method: data.method,
      data: data.data
    })
  },
  prodSpecPage(data) {
    return request({
      url: '/prod/spec/page',
      method: 'POST',
      data
    })
  },
  prodSpecList() {
    return request({
      url: '/prod/spec/list',
      method: 'GET'
    })
  },
  prodSpecDeleteById(ids) {
    return request({
      url: `/prod/spec/${ids}`,
      method: 'delete',
      data: ids
    })
  },
  prodSpecListSpecMaxValueId() {
    return request({
      url: '/prod/spec/listSpecMaxValueId',
      method: 'GET'
    })
  },
  prodSpecListSpecValueById(propId) {
    return request({
      url: `/prod/spec/list-spec-value/${propId}`,
      method: 'GET'
    })
  },
  prodProd(data) {
    return request({
      url: '/prod/v2',
      method: data.method,
      data: data.data
    })
  },
  prodPage(data) {
    return request({
      url: '/prod/page',
      method: 'POST',
      data
    })
  }

}
export default prodApi
